package com.nettyBasic.n7_byteBuf;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.Unpooled;

import static com.nettyBasic.util.ByteBufLog.bufLog;

/**
 * @author： pang-yun
 * @date： 2021-09-14 11:58
 * 功能目的 ：用于  Unpooled 工具类 提供非池化的 Bytebuf 的创建 组合  复制
 */

public class BufUnpooled {
    public static void main(String[] args) {
        ByteBuf buf1 = ByteBufAllocator.DEFAULT.buffer();
        ByteBuf buf2 = ByteBufAllocator.DEFAULT.buffer();

        buf1.writeBytes(new byte[]{1,2,3,4});
        buf2.writeBytes(new byte[]{5,6,7,8});

        ByteBuf buf = Unpooled.wrappedBuffer(buf1, buf2);
        bufLog(buf);
    }
}
